import http from '@/utils/http'

class API {
	static api = new API()
	// 获取 0~7天的内容
	async getBanner(type) {
		return await http.get('/ivmcr/member/banner', {
			type
		}, {
			auth: true
		})
	}

	// 点击开始
	async start() {
		return await http.put('/ivmcr/member/customized', {}, {
			auth: true
		})
	}

	// 点击暂停
	async pause() {
		return await http.put('/ivmcr/member/pause', {}, {
			auth: true
		})
	}

	// 获取状态
	async getStatus(days) {
		return await http.get('/ivmcr/member/status', {
			days
		}, {
			auth: true
		})
	}

	// 课程分类
	async courseCate(type) {
		return await http.get('/ivmcr/member/curriculumCate', {
			type
		}, {
			auth: true
		})
	}

	// 课程分类
	async courseList(type) {
		return await http.get('/ivmcr/member/curriculumList', {
			type
		}, {
			auth: true
		})
	}
	// 课程列表
	async courseInfo(chapter_id) {
		return await http.get('/ivmcr/member/curriculumInfo', {
			chapter_id
		}, {
			auth: true
		})
	}

	//课程图片列表
	async curriculumPicture(chapter_id, page = 1) {
		return await http.get('/ivmcr/member/curriculum_picture', {
			chapter_id,
			page
		}, {
			auth: true
		})
	}


	// 问卷-分类
	async examination(type) {
		return await http.get('/ivmcr/member/examination', {
			type
		}, {
			auth: true
		})
	}
	// 提交
	async submit(days,examination = []) {
		return await http.post('/ivmcr/member/examination', {
			days,
			examination
		}, {
			auth: true
		})
	}

	// 资料库图片详情
	async getGroupPicture(group_id) {
		return await http.get('/ivmcr/member/group_picture/index', {
			group_id
		}, {
			auth: true
		})
	}
}

export default API.api